package com.iva.model;

// Generated 11-03-2013 09:07:49 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * TbMatricula generated by hbm2java
 */
@Entity
@Table(name = "tb_matricula", catalog = "new_escool")
public class TbMatricula implements java.io.Serializable {

	private Integer idMatricula;
	private TbPeriodo tbPeriodo;
	private TbTurno tbTurno;
	private Set<TbInscripcion> tbInscripcions = new HashSet<TbInscripcion>(0);

	public TbMatricula() {
	}

	public TbMatricula(TbPeriodo tbPeriodo, TbTurno tbTurno) {
		this.tbPeriodo = tbPeriodo;
		this.tbTurno = tbTurno;
	}

	public TbMatricula(TbPeriodo tbPeriodo, TbTurno tbTurno,
			Set<TbInscripcion> tbInscripcions) {
		this.tbPeriodo = tbPeriodo;
		this.tbTurno = tbTurno;
		this.tbInscripcions = tbInscripcions;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id_matricula", unique = true, nullable = false)
	public Integer getIdMatricula() {
		return this.idMatricula;
	}

	public void setIdMatricula(Integer idMatricula) {
		this.idMatricula = idMatricula;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "tb_periodo_id_periodo", nullable = false)
	public TbPeriodo getTbPeriodo() {
		return this.tbPeriodo;
	}

	public void setTbPeriodo(TbPeriodo tbPeriodo) {
		this.tbPeriodo = tbPeriodo;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "tb_turno_id_turno", nullable = false)
	public TbTurno getTbTurno() {
		return this.tbTurno;
	}

	public void setTbTurno(TbTurno tbTurno) {
		this.tbTurno = tbTurno;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "tbMatricula")
	public Set<TbInscripcion> getTbInscripcions() {
		return this.tbInscripcions;
	}

	public void setTbInscripcions(Set<TbInscripcion> tbInscripcions) {
		this.tbInscripcions = tbInscripcions;
	}

}
